#ifndef _AMERICO_TIMER_H_
#define _AMERICO_TIMER_H_

#include <windows.h>
#include <vector>
#include "ctime.h"

namespace Clock
{
	class Timer
	{
	public:
		Timer(Clocks aClock=MASTER_CLOCK);
		~Timer();

		void AttachTimer(Timer *aTimer);

		void Update();
		bool Update(const Time &aElapsedTime);
		bool SetPauseState(const bool &aPausedFlag);

		inline Time GetTotalTime() const { return myCurrentTime; }
		inline Time GetElapsedTime() const { return myElapsedTime; }

		inline Clocks GetClock() const { return myCurrentTime.GetClock(); }

		inline bool GetPauseState() const { return myIsPausedFlag; }

	private:
		bool myIsPausedFlag;
		std::vector<Timer*> myAttachedTimers;
		Time myCurrentTime;
		Time myElapsedTime;
		LARGE_INTEGER myPerformanceFrequency;
	};
};

#endif
